package cn.zzq.userscenter.test;

import java.io.FileInputStream;
import java.io.IOException;
import java.net.SocketException;
import java.util.Iterator;

import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.junit.Test;

public class a
{
	@Test
	public void aa()
	{
		FTPClient ftpClient = new FTPClient() ; 
		try
		{
			ftpClient.connect("192.168.241.128", 21);
			ftpClient.login("test", "test123456");
			
			ftpClient.changeWorkingDirectory("/aa");
			
			FTPFile[] files = ftpClient.listFiles();
			for (int i = 0; i < files.length; i++)
			{
				FTPFile ftpFile = files[i];
				System.out.println(ftpFile.getName() + "--" + ftpFile.getSize());
			}
			
			ftpClient.appendFile("bb.sql", new FileInputStream("d:/mybatis.sql"));
		} catch (IOException e)
		{
			e.printStackTrace();
		}
	}
}
